<?php $this->display("objects/breadcrumbs") ?>

<h2>Create Content</h2>

<?php if (count($allowedchilds)): ?>
	<p>What type of content would you like to create?</p>
	
	<ul>
	<?php foreach ($allowedchilds as $i): ?>
		<?php if ($i == $newtype): ?>
			<li><strong><?php _e($i) ?></strong></li>
		<?php else: ?>
			<li><a href="<?php echo Gene::makeLink($object) ?>/new/<?php _e($i) ?>"><?php _e($i) ?></a></li>
		<?php endif; ?>
	<?php endforeach; ?>
	</ul>
	
	<?php if ($saveddraft): ?>
	<p class="success"><strong>Draft has been saved!</strong> You may <a href="<?php echo Gene::makeLink(Gene::objectId($object)) ?>">return to <?php _e($object['title']) ?></a>, view <a href="<?php echo Gene::makeLink(Gene::specialId('Drafts')) ?>">all your drafts</a> or continue editing below.</p>
	<?php endif; ?>
	
	<?php if ($draft): ?>
		<form action="<?php echo Gene::makeLink(Gene::specialId('Drafts')) ?>" method="post">
		<input type="hidden" name="delete" value="<?php echo $draft['draft_id'] ?>" />
		<p><em>Viewing a draft last saved at <?php echo makeDate($draft['draft_time']) ?></em> <input type="submit" value="Delete Draft" /></p>
		</form>
	<?php endif; ?>
	
	<?php if ($newtype): ?>
		<?php if ($errormsg): ?>
			<p class="errormessage"><?php _e($errormsg) ?></p>
		<?php endif; ?>
		
		<?php echo $newobjform ?>
	<?php endif; ?>
<?php else: ?>
	<p>There are no objects you can create here.</p>
<?php endif; ?>